# -*- coding: utf-8 -*-
from django import forms
from django.forms import ModelForm
from catalog.fields import CaptchaField
from catalog.models import Suggestion
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _

class CaptchaTestForm(forms.Form):
	myfield = forms.CharField()
	kontroll = CaptchaField()


class SuggestForm(forms.Form):
	"""Form used for data set suggestions."""
	# Datset name
	name = forms.CharField(label=mark_safe(_("Data set name e.g. <span class='exempel'>Government budget database</span>")), required=True, max_length=255)

	# Name of agency maintaining it.
	agency = forms.CharField(label=mark_safe(_("Responsible organization")), required=True,max_length=255)

	# Suggested description
	description = forms.CharField(label=mark_safe(_("Description (formats, license terms etc.)")), required=False,widget=forms.Textarea)

	# Link to web page for dataset (if any)
	url = forms.URLField(label=_("Link to information page about the data set"), required=False)

	# Topic keywords suggested
	keywords = forms.CharField(label=mark_safe(_("Tags e.g. <span class='exempel'>Economics, Statistics</span>")), required=False,max_length=1000)

	# Name of submitter
	submitter_name = forms.CharField(label=_("Your name"), required=True,max_length=255)
	submitter_email = forms.CharField(label=_("Your email (not shared)"), required=True,max_length=255)

	# Captcha field to prevent spam submissions.
	kontroll = CaptchaField(label=_("Control question (to prevent spam)"))

